deque时间复杂度和vector,list比较

deque supports const time insert and erase operations at the beginning or the end, insert or erase in the middle take linear time.

vector在中间位置插入和删除操作时间复杂度为O(N);vector的push_back, pop_back操作时间复杂度为O(1), 头部插入和删除操作时间复杂度为O(N);deque的push_back, push_front, pop_back, pop_front操作时间复杂度为O(1);

posted @ 2015-06-24 21:20  kkshaq  阅读(2959)  评论(0编辑  收藏  举报